/****************************************************************************
 * Copyright (c) 2004 Composent, Inc. and others.
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * Contributors:
 *    Composent, Inc. - initial API and implementation
 *
 * SPDX-License-Identifier: EPL-2.0
 *****************************************************************************/

package org.eclipse.ecf.presence.im;

import java.util.Map;

import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.util.ECFException;

/**
 * Chat message sender.
 */
public interface IChatMessageSender {

	/**
	 * Send chat message to given ID.
	 * 
	 * @param toID
	 *            the target receiver to receive the chat message. Must not be
	 *            <code>null</code>.
	 * 
	 * @param threadID
	 *            the threadID for the message. May be <code>null</code>.
	 * 
	 * @param type
	 *            the IChatMessage.Type of the message. May not be null.
	 * 
	 * @param subject
	 *            the subject of the message. May be null.
	 * 
	 * @param body
	 *            the body of the message to send. May be null.
	 * 
	 * @param properties
	 *            properties associated with message. May be null.
	 * 
	 * @throws ECFException
	 *             thrown if toID is null, or currently disconnected
	 */
	public void sendChatMessage(ID toID, ID threadID, IChatMessage.Type type,
			String subject, String body, Map properties) throws ECFException;

	/**
	 * Send chat message to given ID.
	 * 
	 * @param toID
	 *            the target receiver to receive the chat message. Must not be
	 *            null.
	 * 
	 * @param body
	 *            the body of the message to send. May be null.
	 * 
	 * @throws ECFException
	 *             thrown if toID is null, or currently disconnected
	 */
	public void sendChatMessage(ID toID, String body) throws ECFException;

}
